package com.artezio.task.services;

import com.artezio.task.model.Contact;
import com.artezio.task.model.ContactTelDetail;
import org.springframework.transaction.annotation.Transactional;

import java.io.UnsupportedEncodingException;
import java.util.List;

public interface ContactsService {

    @Transactional
    void addNewContact(Contact contact);

    @Transactional
    void saveContact(Contact contact);

    void incVersion(Contact contact);

    Contact createRandomContact();

    @Transactional
    List<Contact> getAllContacts();

    @Transactional
    Contact findContactById(int id);

    @Transactional
    void deleteContactById(int id);

    @Transactional
    void deleteContact(Contact contact);

    List<Contact> getContactsByCriteria(String firstName, String lastName, String telType, String telNumber);

    void addNewContactTelDetail(Contact contact, ContactTelDetail contactTelDetail);

    void saveContactTelDetail(ContactTelDetail contactTelDetail);

    List<ContactTelDetail> getAllContactTelDetails();

    ContactTelDetail findContactTelDetailById(int id);

    void deleteContactTelDetailById(int id);

    void deleteContactTelDetail(ContactTelDetail contactTelDetail);

    List<ContactTelDetail> getContactsTelDetailByCriteria();

    List<Contact> getContactsByCriteriaSortByNameAjax(String firstName, String lastName, String telType, String telNumber, String order);

    List<Contact> getContactsByCriteriaSortByLastNameAjax(String firstName, String lastName, String telType, String telNumber, String order);

    List<Contact> getContactsByCriteriaPaginAjax(String firstName, String lastName, int maxRes,int firstRes, String order, String sSearch) throws UnsupportedEncodingException;
}
